package com.nit.elasticsearch.moudles.jd.controller;

import com.nit.elasticsearch.moudles.jd.service.impl.JdServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author :fjw
 * @description:TODO
 * @date :2020/11/14 14:20
 */
@Controller
@RequiredArgsConstructor
public class JdController {

	private final JdServiceImpl jdService;
	@ResponseBody
	@GetMapping("/search/{keyword}/{from}/{size}")
	public List<Map<String,Object>> search(@PathVariable String keyword, @PathVariable int from, @PathVariable int size) {
		List<Map<String, Object>> search = jdService.search(keyword, from, size);
		return search;
	}
}
